/*
So Gong
--- Challenge, Belt, Info, Quit
Main NPC Creater - DevFatal
Cleanup + some additional things - Buya
*/

void npc(Player @player, NPC @npc) {
	int state = npc.getState();
	int map = player.getMap().getID();
	int type = npc.getSelected();
	int white = 200;
	int yellow = 1800;
	int blue = 4000;
	int red = 9200;
	int black = 17000;
	npc.setVariable("type", type);
	if(map == 925020001){
		if(state == 0){
			npc.addText("Welcome to Mu Lung Dojo!\r\nYou currently have #r"+ /*player.getTrainingPoints()*/1 +"#k training points.#b\r\n#L0#Challenge the Dojo!#l\r\n#L1#Exchange Points for Belt#l\r\n#L2#Reset Training Points#l\r\n#L3#What is a Mu Lung Dojo?#l#k");
			npc.sendSimple();
		}
		if(state == 1){
			if(type == 0){
				npc.addText("Are you sure?");
				npc.sendYesNo();
			}
			if(type == 1){ //ignore the stupid types here for right now
			npc.addText("You currently have #r"+ /*player.getTrainingPoints()*/1 +"#k points.\r\nWhich belt would you like to receive? It doesn't subtract from your points.\r\n#L4##i1132000#   - White Belt : Points Required : #r"+ white +"#k#l\r\n#L5##i1132001#   - Yellow Belt : Points Required : #r"+ yellow +"#k#l\r\n#L6##i1132002#   - Blue Belt : Points Required : #r"+ blue +"#k#l\r\n#L7##i1132003#   - Red Belt : Points Required : #r"+ red +"#k#l\r\n#L8##i1132004#   - Black Belt : Points Required : #r"+ black +"#k#l");
			npc.sendSimple();
			npc.end();
			}
			if(type == 2){
				npc.addText("Are you sure you want to reset your Training Points?");
				npc.setState(npc.getState()+1);
				npc.sendYesNo();
			}
			if(type == 3){
				npc.addText("Our master is the strongest person in Mu Lung. The place he built is called the Mu Lung Dojo, a building that is 38 stories tall! You can train yourself as you go up each level.\r\nOf course, it'll be hard for someone at your level to reach the top.");
				npc.sendOK();
				npc.end();
			}
		}
		if(state == 2){
			if(npc.getSelected() == YES){
			player.changeMap(925020100);
			player.dojoAnimation();
			npc.end();
			}
			else{
				npc.addText("Off you go...");
				npc.sendNext();
				npc.end();
			}
		}
		if(state == 3){
			if(npc.getSelected() == YES){
			//player.setTrainingPoints(0);
			npc.addText("You now have #r"+ /*player.getTrainingPoints()*/1 +"#k points.");
			npc.sendNext();
			npc.end();
			}
			else{
				npc.addText("Until next time then. Bye.");
				npc.sendNext();
				npc.end();
			}
		}
	}
	else if(map == 925020600){
		if(state == 0){
				npc.addText("Are you all pumped up for the next couple stages?");
				npc.sendYesNo();
			}
		if(state == 1){
			if(npc.getSelected() == YES){
			player.changeMap(925020700);
			player.dojoAnimation();
					npc.end();
				}
			else{
				npc.addText("Talk to me when you want to continue.");
				npc.sendNext();
				npc.end();
			}
		}
	}
	else if(map == 925021200){
		if(state == 0){
				npc.addText("Are you all pumped up for the next couple stages?");
				npc.sendYesNo();
			}
		if(state == 1){
			if(npc.getSelected() == YES){
			player.changeMap(925021300);
			player.dojoAnimation();
					npc.end();
				}
			else{
				npc.addText("Talk to me when you want to continue.");
				npc.sendNext();
				npc.end();
			}
		}
	}
	else if(map == 925021800){
		if(state == 0){
				npc.addText("Are you all pumped up for the next couple stages?");
				npc.sendYesNo();
			}
		if(state == 1){
			if(npc.getSelected() == YES){
			player.changeMap(925021900);
			player.dojoAnimation();
					npc.end();
				}
			else{
				npc.addText("Talk to me when you want to continue.");
				npc.sendNext();
				npc.end();
			}
		}
	}
	else if(map == 925022400){
		if(state == 0){
				npc.addText("Are you all pumped up for the next couple stages?");
				npc.sendYesNo();
			}
		if(state == 1){
			if(npc.getSelected() == YES){
			player.changeMap(925022500);
			player.dojoAnimation();
					npc.end();
				}
			else{
				npc.addText("Talk to me when you want to continue.");
				npc.sendNext();
				npc.end();
			}
		}
	}
	else if(map == 925023000){
		if(state == 0){
				npc.addText("Are you all pumped up for the next couple stages?");
				npc.sendYesNo();
			}
		if(state == 1){
			if(npc.getSelected() == YES){
			player.changeMap(925023100);
			player.dojoAnimation();
					npc.end();
				}
			else{
				npc.addText("Talk to me when you want to continue.");
				npc.sendNext();
				npc.end();
			}
		}
	}
	else if(map == 925023600){
		if(state == 0){
				npc.addText("Are you all pumped up for the next couple stages?");
				npc.sendYesNo();
			}
		if(state == 1){
			if(npc.getSelected() == YES){
			player.changeMap(925023700);
			player.dojoAnimation();
					npc.end();
				}
			else{
				npc.addText("Talk to me when you want to continue.");
				npc.sendNext();
				npc.end();
			}
		}
	}
	else{
		if(state == 0){
			npc.addText("Do you want to leave the challenge?");
			npc.sendYesNo();
		}
		else if(state == 1){
			if(npc.getSelected() == YES){
				player.changeMap(925020001);
				npc.end();
			}
			else{
				npc.end();
			}
		}
	}
}